package com.luck.feignClients;

import com.luck.config.FeignConfig;
import com.luck.config.dto.Order;
import com.luck.config.dto.OrderQuery;
import com.luck.config.dto.OrderingDTO;
import com.luck.config.dto.OrderingOk;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@FeignClient(name="order-service",configuration = FeignConfig.class)
@RequestMapping("/api/order")
public interface OrderServiceClient {
    @GetMapping
    public List<Order> select(@SpringQueryMap OrderQuery query);
    @PostMapping
    public OrderingOk ordering(@RequestBody OrderingDTO dto);

}
